home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Steal This CD
/
steal_this_cd.iso
/
Chapter 07 - Where the Hackers Are
/
virc200.exe
/
{app}
/
Scripts
/
virc.lib
< prev
next >
Wrap
Text File
|
2003-12-25
|
72KB
|
2,518 lines
// Visual IRC 2.0 default script library
// Main IRC client interface
@ $LibVersion = 2.0
@ $LibBuild = 200
@ $LibMessageVersion = 4
@l $RequiredViRC = 200
@l $RequiredPre = 14
@l $RequiredVersion = 2.0rc4
if ([${FirstRun}] == []) && ([$2] == [firstrun])
@ $FirstRun = 1
else
@ $FirstRun = 0
endif
// Message translations supplied with ViRC:
// english.lib (English messages)
@l $translation = english.lib
Load $translation
//--------------
// Client version check
if ($build < $RequiredViRC) || (($build == $RequiredViRC) && ($prebuild != 0) && ($prebuild < $RequiredPre))
@l $msg = $eval($Msg_RequiredVersion)
if ($messagedlg(305 $msg) == 2)
Exit
endif
endif
// Message version check
if [$IgnoreMessageVersion] == [$$IgnoreMessageVersion]
@s $IgnoreMessageVersion = 0
endif
if [$MessageVersion] == [$$MessageVersion]
MessageBox Invalid message file: $translation
else if ($MessageVersion < $LibMessageVersion) && ($IgnoreMessageVersion < $LibMessageVersion)
MessageBox $eval($Msg_OutdatedMessages)
@s $IgnoreMessageVersion = $LibMessageVersion
endif
//--------------
// localization helpers
Alias _XW_LOCALIZE_MENUTREE
for (@l $i = 0; $i < $prop($__Block__.Count); $i++)
@l $line = $__Block__.GetString($i)
@l $before = $strtokl(@@ $line)
@l $after = $strtokr(@@ $line)
if [$after] != []
$__Block__.SetString $i $before${$after}
endif
endfor
$__Block__.SaveToMenuTree $1
EndAlias
ExtendWith localized_menutree [xwEvalParams,xwNewContext] = _XW_LOCALIZE_MENUTREE
Alias _XW_LOCALIZE_TOOLBAR
for (@l $i = 0; $i < $prop($__Block__.Count); $i++)
@l $line = $__Block__.GetString($i)
@l $before = $strtokl(@@ $line)
@l $after = $strtokr(@@ $line)
if [$after] != []
$__Block__.SetString $i $before${$after}
endif
endfor
$__Block__.SaveToToolbar $1-
EndAlias
ExtendWith localized_toolbar [xwEvalParams,xwNewContext] = _XW_LOCALIZE_TOOLBAR
//--------------
// first-time users: what add-ons should we use initially?
if $FirstRun
@l $try_addons = smileys.vsc sounds.vsc
// is Winamp running, by chance?
if $FindWindow("Winamp v1.x")
@l $try_addons = $listcat($try_addons winamp.vsc)
endif
// make sure the scripts really exist
@l $addons = $null
foreach ($i; $try_addons)
if $fileexists($getpath(script)$i)
@l $addons = $listcat($addons $i)
endif
endforeach
@ $RecommendedAddOns = $addons
endif
//--------------
With > localized_menutree MT_MAINMENU
M_FILE <none> 0 0 @@Msg_File_Caption
M_FILENEWSERVER Ctrl+S 0 1 "tbstart.bmp" @@Msg_File_NewServerCaption
M_CLIENTSETUP <none> 0 1 "tbconfig.bmp" @@Msg_File_ClientSetupCaption
M_SCRIPTEDITOR <none> 0 1 "tbscript.bmp" @@Msg_File_ScriptEditorCaption
M_NOTIFYSETUP <none> 0 1 @@Msg_File_NotifySetupCaption
M_SERVERLIST <none> 0 1 @@Msg_File_ServerListCaption
M_FILESEP1 <none> 0 1 -
M_DCCLIST Ctrl+D 0 1 @@Msg_File_DCCListCaption
M_FILESEP2 <none> 0 1 -
M_GETSMART <none> 0 1 "tbglobe.bmp" @@Msg_File_GetSmartCaption
M_FILEEXIT Alt+X 0 1 "tbexit_sm.bmp" @@Msg_File_ExitCaption
M_VIEW <none> 0 0 @@Msg_View_Caption
M_STATUSON <none> !%isstatusvisible 1 @@Msg_View_StatusOnCaption
M_STATUSOFF <none> %isstatusvisible 1 @@Msg_View_StatusOffCaption
EndWith
MenuHint M_FILENEWSERVER on MT_MAINMENU = $Msg_File_NewServerHint
MenuHint M_CLIENTSETUP on MT_MAINMENU = $Msg_File_ClientSetupHint
MenuHint M_SCRIPTEDITOR on MT_MAINMENU = $Msg_File_ScriptEditorHint
MenuHint M_NOTIFYSETUP on MT_MAINMENU = $Msg_File_NotifySetupHint
MenuHint M_SERVERLIST on MT_MAINMENU = $Msg_File_ServerListHint
MenuHint M_DCCLIST on MT_MAINMENU = $Msg_File_DCCListHint
MenuHint M_GETSMART on MT_MAINMENU = $Msg_File_GetSmartHint
MenuHint M_FILEEXIT on MT_MAINMENU = $Msg_File_ExitHint
MenuHint M_STATUSON on MT_MAINMENU = $Msg_View_StatusOnHint
MenuHint M_STATUSOFF on MT_MAINMENU = $Msg_View_StatusOffHint
MenuItem M_FILENEWSERVER on MT_MAINMENU
NewServerWindow
EndMenuItem
MenuItem M_CLIENTSETUP on MT_MAINMENU
ShowClientSetup
EndMenuItem
MenuItem M_SCRIPTEDITOR on MT_MAINMENU
ShowScriptEditor
EndMenuItem
MenuItem M_NOTIFYSETUP on MT_MAINMENU
ShowNotifySetup
EndMenuItem
MenuItem M_SERVERLIST on MT_MAINMENU
ShowServerList
EndMenuItem
MenuItem M_DCCLIST on MT_MAINMENU
ShowDCCList
EndMenuItem
MenuItem M_FILEEXIT on MT_MAINMENU
Exit
EndMenuItem
MenuItem M_GETSMART on MT_MAINMENU
CheckForUpdates
EndMenuItem
MenuItem M_STATUSON on MT_MAINMENU
EnableStatus
EndMenuItem
MenuItem M_STATUSOFF on MT_MAINMENU
DisableStatus
EndMenuItem
With > localized_menutree MT_TRAYPOPUP
M_EXIT <none> 0 0 "tbexit_sm.bmp" @@Msg_Tray_ExitCaption
EndWith
MenuItem M_EXIT on MT_TRAYPOPUP
Exit
EndMenuItem
// logging/timestamp popup is merged into all text output windows
With > localized_menutree MT_LOGGING
M_LOGGING <none> 0 0 @@Msg_Log_LoggingCaption
M_OPENLOG <none> !%islogging 1 "tbopenlog.bmp" @@Msg_Log_OpenLogCaption
M_CLOSELOG <none> %islogging 1 "tbcloselog.bmp" @@Msg_Log_CloseLogCaption
M_VIEWLOG <none> 0 1 "tblogging.bmp" @@Msg_Log_ViewLogCaption
M_TIMESTAMP <none> 0 0 @@Msg_Log_TimestampCaption
M_SHOWTS <none> !%istimestamping 1 "tbtimestampon.bmp" @@Msg_Log_ShowTSCaption
M_HIDETS <none> %istimestamping 1 "tbtimestampoff.bmp" @@Msg_Log_HideTSCaption
EndWith
MenuHint M_OPENLOG on MT_LOGGING = $Msg_Log_OpenLogHint
MenuHint M_CLOSELOG on MT_LOGGING = $Msg_Log_CloseLogHint
MenuHint M_VIEWLOG on MT_LOGGING = $Msg_Log_ViewLogHint
MenuHint M_SHOWTS on MT_LOGGING = $Msg_Log_ShowTSHint
MenuHint M_HIDETS on MT_LOGGING = $Msg_Log_HideTSHint
Alias ISTIMESTAMPING
@l $obj = $mapobject($1:Output)
@ $fresult = $([$prop($obj.TimeStamps)] == [True])
UnmapObject $obj
EndAlias
MenuItem M_OPENLOG on MT_LOGGING
Log open $C
EndMenuItem
MenuItem M_CLOSELOG on MT_LOGGING
Log close $C
EndMenuItem
MenuItem M_VIEWLOG on MT_LOGGING
if $ischannel($C)
@l $file = $eval($getsetting(Logging ChannelLog))
else if [$C] == [.]
@l $file = $eval($getsetting(Logging ServerLog))
else if $isquerying($C)
@l $file = $eval($getsetting(Logging QueryLog))
else if $isdccchatting($C)
@l $file = $eval($getsetting(Logging ChatLog))
else
Halt
endif
// don't open programs or scripts
@l $ext = $rstrtokr(. $file)
Halt if $isinset([$ext] [exe,com,vsc])
Exec "$getpath(log)$file"
EndMenuItem
MenuItem M_SHOWTS on MT_LOGGING
@l $obj = $mapobject($C:Output)
@p $obj.TimeStamps = True
UnmapObject $obj
EndMenuItem
MenuItem M_HIDETS on MT_LOGGING
@l $obj = $mapobject($C:Output)
@p $obj.TimeStamps = False
UnmapObject $obj
EndMenuItem
With > localized_menutree MT_SERVERPOPUP
M_CONNECT <none> 2 0 "tbconnect.bmp" @@Msg_Serv_ConnectCaption
M_DISCONNECT <none> 1 0 "tbdisconnect.bmp" @@Msg_Serv_DisconnectCaption
EndWith
MenuHint M_CONNECT on MT_SERVERPOPUP = $Msg_Serv_ConnectHint
MenuHint M_DISCONNECT on MT_SERVERPOPUP = $Msg_Serv_DisconnectHint
MenuItem M_CONNECT on MT_SERVERPOPUP
Connect
EndMenuItem
MenuItem M_DISCONNECT on MT_SERVERPOPUP
Disconnect
EndMenuItem
With > localized_menutree MT_NOTIFYPOPUP
M_WHOIS <none> 0 0 @@Msg_Nick_WhoisCaption
M_WII <none> 0 0 @@Msg_Nick_WiiCaption
M_QUERY <none> 0 0 @@Msg_Nick_QueryCaption
M_DCC <none> 0 0 @@Msg_Nick_DCCCaption
M_DCCCHAT <none> 0 1 @@Msg_Nick_DCCChatCaption
M_DCCWBOARD <none> 0 1 @@Msg_Nick_DCCWboardCaption
M_DCCSEND <none> 0 1 @@Msg_Nick_DCCSendCaption
M_TDCCSEND <none> 0 1 @@Msg_Nick_TDCCSendCaption
M_CTCP <none> 0 0 @@Msg_Nick_CTCPCaption
M_CTCPTIME <none> 0 1 @@Msg_Nick_CTCPTimeCaption
M_CTCPVER <none> 0 1 @@Msg_Nick_CTCPVerCaption
M_CTCPPING <none> 0 1 @@Msg_Nick_CTCPPingCaption
EndWith
MenuHint M_WHOIS on MT_NOTIFYPOPUP = $Msg_Nick_WhoisHint
MenuHint M_WII on MT_NOTIFYPOPUP = $Msg_Nick_WiiHint
MenuHint M_QUERY on MT_NOTIFYPOPUP = $Msg_Nick_QueryHint
MenuHint M_DCCCHAT on MT_NOTIFYPOPUP = $Msg_Nick_DCCChatHint
MenuHint M_DCCWBOARD on MT_NOTIFYPOPUP = $Msg_Nick_DCCWboardHint
MenuHint M_DCCSEND on MT_NOTIFYPOPUP = $Msg_Nick_DCCSendHint
MenuHint M_TDCCSEND on MT_NOTIFYPOPUP = $Msg_Nick_TDCCSendHint
MenuHint M_CTCPTIME on MT_NOTIFYPOPUP = $Msg_Nick_CTCPTimeHint
MenuHint M_CTCPVER on MT_NOTIFYPOPUP = $Msg_Nick_CTCPVerHint
MenuHint M_CTCPPING on MT_NOTIFYPOPUP = $Msg_Nick_CTCPPingHint
MenuItem <DoubleClick> on MT_NOTIFYPOPUP
if [$1] != []
Whois $1
endif
EndMenuItem
MenuItem M_WHOIS on MT_NOTIFYPOPUP
Whois $1
EndMenuItem
MenuItem M_WII on MT_NOTIFYPOPUP
Wii $1
EndMenuItem
MenuItem M_QUERY on MT_NOTIFYPOPUP
Query $1
EndMenuItem
MenuItem M_DCCCHAT on MT_NOTIFYPOPUP
DCC Chat $1
EndMenuItem
MenuItem M_DCCWBOARD on MT_NOTIFYPOPUP
DCC Whiteboard $1
EndMenuItem
MenuItem M_DCCSEND on MT_NOTIFYPOPUP
DCC Send $1
EndMenuItem
MenuItem M_TDCCSEND on MT_NOTIFYPOPUP
TDCC Send $1
EndMenuItem
MenuItem M_CTCPTIME on MT_NOTIFYPOPUP
CTCP $1 TIME
EndMenuItem
MenuItem M_CTCPVER on MT_NOTIFYPOPUP
CTCP $1 VERSION
EndMenuItem
MenuItem M_CTCPPING on MT_NOTIFYPOPUP
Ping $1
EndMenuItem
With > localized_menutree MT_CHANNELNICKSPOPUP
M_WHOIS <none> 0 0 @@Msg_Nick_WhoisCaption
M_WII <none> 0 0 @@Msg_Nick_WiiCaption
M_QUERY <none> 0 0 @@Msg_Nick_QueryCaption
M_DCC <none> 0 0 @@Msg_Nick_DCCCaption
M_DCCCHAT <none> 0 1 @@Msg_Nick_DCCChatCaption
M_DCCWBOARD <none> 0 1 @@Msg_Nick_DCCWboardCaption
M_DCCSEND <none> 0 1 @@Msg_Nick_DCCSendCaption
M_TDCCSEND <none> 0 1 @@Msg_Nick_TDCCSendCaption
M_SEP1 <none> 0 1 -
M_DCCALLOW <none> 0 1 @@Msg_Nick_DCCAllowCaption
M_DCCADD <none> 0 2 @@Msg_Nick_DCCAddCaption
M_DCCDEL <none> 0 2 @@Msg_Nick_DCCDelCaption
M_CTCP <none> 0 0 @@Msg_Nick_CTCPCaption
M_CTCPTIME <none> 0 1 @@Msg_Nick_CTCPTimeCaption
M_CTCPVER <none> 0 1 @@Msg_Nick_CTCPVerCaption
M_CTCPPING <none> 0 1 @@Msg_Nick_CTCPPingCaption
M_SEP2 <none> 0 0 -
M_OP <none> 1 0 @@Msg_Nick_OpCaption
M_DEOP <none> 1 0 @@Msg_Nick_DeopCaption
M_VOICE <none> 1 0 @@Msg_Nick_VoiceCaption
M_DEVOICE <none> 1 0 @@Msg_Nick_DevoiceCaption
M_KICK <none> 1 0 @@Msg_Nick_KickCaption
M_KICKBAN <none> 1 0 @@Msg_Nick_KickBanCaption
M_SEP3 <none> 0 0 -
M_IGNORE <none> !%isignoringnick 0 @@Msg_Nick_IgnoreCaption
M_UNIGNORE <none> %isignoringnick 0 @@Msg_Nick_UnignoreCaption
EndWith
MenuHint M_WHOIS on MT_CHANNELNICKSPOPUP = $Msg_Nick_WhoisHint
MenuHint M_WII on MT_CHANNELNICKSPOPUP = $Msg_Nick_WiiHint
MenuHint M_QUERY on MT_CHANNELNICKSPOPUP = $Msg_Nick_QueryHint
MenuHint M_DCCCHAT on MT_CHANNELNICKSPOPUP = $Msg_Nick_DCCChatHint
MenuHint M_DCCWBOARD on MT_CHANNELNICKSPOPUP = $Msg_Nick_DCCWboardHint
MenuHint M_DCCSEND on MT_CHANNELNICKSPOPUP = $Msg_Nick_DCCSendHint
MenuHint M_TDCCSEND on MT_CHANNELNICKSPOPUP = $Msg_Nick_TDCCSendHint
MenuHint M_DCCALLOW on MT_CHANNELNICKSPOPUP = $Msg_Nick_DCCAllowHint
MenuHint M_DCCADD on MT_CHANNELNICKSPOPUP = $Msg_Nick_DCCAddHint
MenuHint M_DCCDEL on MT_CHANNELNICKSPOPUP = $Msg_Nick_DCCDelHint
MenuHint M_CTCPTIME on MT_CHANNELNICKSPOPUP = $Msg_Nick_CTCPTimeHint
MenuHint M_CTCPVER on MT_CHANNELNICKSPOPUP = $Msg_Nick_CTCPVerHint
MenuHint M_CTCPPING on MT_CHANNELNICKSPOPUP = $Msg_Nick_CTCPPingHint
MenuHint M_OP on MT_CHANNELNICKSPOPUP = $Msg_Nick_OpHint
MenuHint M_DEOP on MT_CHANNELNICKSPOPUP = $Msg_Nick_DeopHint
MenuHint M_VOICE on MT_CHANNELNICKSPOPUP = $Msg_Nick_VoiceHint
MenuHint M_DEVOICE on MT_CHANNELNICKSPOPUP = $Msg_Nick_DevoiceHint
MenuHint M_KICK on MT_CHANNELNICKSPOPUP = $Msg_Nick_KickHint
MenuHint M_KICKBAN on MT_CHANNELNICKSPOPUP = $Msg_Nick_KickBanHint
MenuHint M_IGNORE on MT_CHANNELNICKSPOPUP = $Msg_Nick_IgnoreHint
MenuHint M_UNIGNORE on MT_CHANNELNICKSPOPUP = $Msg_Nick_UnignoreHint
MenuItem <DoubleClick> on MT_CHANNELNICKSPOPUP
if [$1] != []
Whois $1
endif
EndMenuItem
MenuItem M_WHOIS on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
Whois $i
endforeach
EndMenuItem
MenuItem M_WII on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
Wii $i
endforeach
EndMenuItem
MenuItem M_QUERY on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
Query $i
endforeach
EndMenuItem
MenuItem M_DCCCHAT on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
DCC Chat $i
endforeach
EndMenuItem
MenuItem M_DCCWBOARD on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
DCC Whiteboard $i
endforeach
EndMenuItem
MenuItem M_DCCSEND on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
DCC Send $i
endforeach
EndMenuItem
MenuItem M_TDCCSEND on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
TDCC Send $i
endforeach
EndMenuItem
MenuItem M_DCCADD on MT_CHANNELNICKSPOPUP
// dccallow +nick1,+nick2,+nick3...
@l $list = $null
foreach ($i; $listfromwords($1-))
@l $list = $list,+$i
endforeach
Quote DCCALLOW $strtokr(, $list)
EndMenuItem
MenuItem M_DCCDEL on MT_CHANNELNICKSPOPUP
// dccallow -nick1,-nick2,-nick3...
@l $list = $null
foreach ($i; $listfromwords($1-))
@l $list = $list,-$i
endforeach
Quote DCCALLOW $strtokr(, $list)
EndMenuItem
// I would love to use a multi-variable foreach here, but some
// efnet servers don't allow /msg nick1,nick2,nick3 anymore.
MenuItem M_CTCPTIME on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
CTCP $i TIME
endforeach
EndMenuItem
MenuItem M_CTCPVER on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
CTCP $i VERSION
endforeach
EndMenuItem
MenuItem M_CTCPPING on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
Ping $1
endforeach
EndMenuItem
MenuItem M_OP on MT_CHANNELNICKSPOPUP
foreach ($a,$b,$c,$d; $listfromwords($1-))
Mode $C +oooo $a $b $c $d
endforeach
EndMenuItem
MenuItem M_DEOP on MT_CHANNELNICKSPOPUP
foreach ($a,$b,$c,$d; $listfromwords($1-))
Mode $C -oooo $a $b $c $d
endforeach
EndMenuItem
MenuItem M_VOICE on MT_CHANNELNICKSPOPUP
foreach ($a,$b,$c,$d; $listfromwords($1-))
Mode $C +vvvv $a $b $c $d
endforeach
EndMenuItem
MenuItem M_DEVOICE on MT_CHANNELNICKSPOPUP
foreach ($a,$b,$c,$d; $listfromwords($1-))
Mode $C -vvvv $a $b $c $d
endforeach
EndMenuItem
MenuItem M_KICK on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
Kick $C $i
endforeach
EndMenuItem
MenuItem M_KICKBAN on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
KB $C $i
endforeach
EndMenuItem
MenuItem M_IGNORE on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
Ignore $i
endforeach
EndMenuItem
MenuItem M_UNIGNORE on MT_CHANNELNICKSPOPUP
foreach ($i; $listfromwords($1-))
UnIgnore $i
endforeach
EndMenuItem
With > localized_menutree MT_CHANNELTEXTPOPUP
M_CONTROL <none> 0 0 "tbchanctl.bmp" @@Msg_Chan_ControlCaption
M_SEP1 <none> 0 0 -
M_BUFFER <none> 0 0 @@Msg_Chan_BufferCaption
M_BUFCLEAR <none> 0 1 @@Msg_Chan_BufClearCaption
M_BUFSAVE <none> 0 1 @@Msg_Chan_BufSaveCaption
M_CTCP <none> 0 0 @@Msg_Chan_CTCPCaption
M_CTCPTIME <none> 0 1 @@Msg_Chan_CTCPTimeCaption
M_CTCPVER <none> 0 1 @@Msg_Chan_CTCPVerCaption
M_CTCPPING <none> 0 1 @@Msg_Chan_CTCPPingCaption
M_PART <none> 0 0 @@Msg_Chan_PartCaption
M_DOPART <none> 0 1 "tbpart.bmp" @@Msg_Chan_DoPartCaption
M_CYCLE <none> 0 1 "tbcycle.bmp" @@Msg_Chan_CycleCaption
EndWith
MenuHint M_CONTROL on MT_CHANNELTEXTPOPUP = $Msg_Chan_ControlHint
MenuHint M_BUFCLEAR on MT_CHANNELTEXTPOPUP = $Msg_Chan_BufClearHint
MenuHint M_BUFSAVE on MT_CHANNELTEXTPOPUP = $Msg_Chan_BufSaveHint
MenuHint M_CTCPTIME on MT_CHANNELTEXTPOPUP = $Msg_Chan_CTCPTimeHint
MenuHint M_CTCPVER on MT_CHANNELTEXTPOPUP = $Msg_Chan_CTCPVerHint
MenuHint M_CTCPPING on MT_CHANNELTEXTPOPUP = $Msg_Chan_CTCPPingHint
MenuHint M_DOPART on MT_CHANNELTEXTPOPUP = $Msg_Chan_DoPartHint
MenuHint M_CYCLE on MT_CHANNELTEXTPOPUP = $Msg_Chan_CycleHint
MenuItem <DoubleClick> on MT_CHANNELTEXTPOPUP
ChannelControl $C
EndMenuItem
MenuItem M_CONTROL on MT_CHANNELTEXTPOPUP
ChannelControl $C
EndMenuItem
MenuItem M_BUFCLEAR on MT_CHANNELTEXTPOPUP
Clear $C
EndMenuItem
MenuItem M_BUFSAVE on MT_CHANNELTEXTPOPUP
@l $filename = $savedialog($Msg_BufSave_DialogSpec)
Halt if [$filename] == []
CreateFile $filename
@l $obj = $mapobject($C:Output)
AppendText $listquote($filename) $obj.GetText()
UnmapObject $obj
EndMenuItem
MenuItem M_CTCPTIME on MT_CHANNELTEXTPOPUP
CTCP $C TIME
EndMenuItem
MenuItem M_CTCPVER on MT_CHANNELTEXTPOPUP
CTCP $C VERSION
EndMenuItem
MenuItem M_CTCPPING on MT_CHANNELTEXTPOPUP
Ping $C
EndMenuItem
MenuItem M_DOPART on MT_CHANNELTEXTPOPUP
Part $C
EndMenuItem
MenuItem M_CYCLE on MT_CHANNELTEXTPOPUP
Cycle $C
EndMenuItem
With > localized_menutree MT_QUERYPOPUP
M_WHOIS <none> 0 0 @@Msg_Nick_WhoisCaption
M_WII <none> 0 0 @@Msg_Nick_WiiCaption
M_DCC <none> 0 0 @@Msg_Nick_DCCCaption
M_DCCCHAT <none> 0 1 @@Msg_Nick_DCCChatCaption
M_DCCWBOARD <none> 0 1 @@Msg_Nick_DCCWboardCaption
M_DCCSEND <none> 0 1 @@Msg_Nick_DCCSendCaption
M_TDCCSEND <none> 0 1 @@Msg_Nick_TDCCSendCaption
M_CTCP <none> 0 0 @@Msg_Nick_CTCPCaption
M_CTCPTIME <none> 0 1 @@Msg_Nick_CTCPTimeCaption
M_CTCPVER <none> 0 1 @@Msg_Nick_CTCPVerCaption
M_CTCPPING <none> 0 1 @@Msg_Nick_CTCPPingCaption
EndWith
MenuHint M_WHOIS on MT_QUERYPOPUP = $Msg_Nick_WhoisHint
MenuHint M_WII on MT_QUERYPOPUP = $Msg_Nick_WiiHint
MenuHint M_DCCCHAT on MT_QUERYPOPUP = $Msg_Nick_DCCChatHint
MenuHint M_DCCWBOARD on MT_QUERYPOPUP = $Msg_Nick_DCCWboardHint
MenuHint M_DCCSEND on MT_QUERYPOPUP = $Msg_Nick_DCCSendHint
MenuHint M_TDCCSEND on MT_QUERYPOPUP = $Msg_Nick_TDCCSendHint
MenuHint M_CTCPTIME on MT_QUERYPOPUP = $Msg_Nick_CTCPTimeHint
MenuHint M_CTCPVER on MT_QUERYPOPUP = $Msg_Nick_CTCPVerHint
MenuHint M_CTCPPING on MT_QUERYPOPUP = $Msg_Nick_CTCPPingHint
MenuItem <DoubleClick> on MT_QUERYPOPUP
Whois $nick
EndMenuItem
MenuItem M_WHOIS on MT_QUERYPOPUP
Whois $nick
EndMenuItem
MenuItem M_WII on MT_QUERYPOPUP
Wii $nick
EndMenuItem
MenuItem M_DCCCHAT on MT_QUERYPOPUP
DCC Chat $1
EndMenuItem
MenuItem M_DCCWBOARD on MT_QUERYPOPUP
DCC Whiteboard $1
EndMenuItem
MenuItem M_DCCSEND on MT_QUERYPOPUP
DCC Send $1
EndMenuItem
MenuItem M_TDCCSEND on MT_QUERYPOPUP
TDCC Send $1
EndMenuItem
MenuItem M_CTCPTIME on MT_QUERYPOPUP
CTCP $1 TIME
EndMenuItem
MenuItem M_CTCPVER on MT_QUERYPOPUP
CTCP $1 VERSION
EndMenuItem
MenuItem M_CTCPPING on MT_QUERYPOPUP
Ping $1
EndMenuItem
//--------------
Event JOIN "% JOIN *"
if ($isignoring($nick!$user@$host))
@l $bmp = _joinign.bmp
else
@l $bmp = _join.bmp
endif
@l $nickstr = \b$_active(nick $nick) ($user@$_active(host $host))\b
@l $chanstr = $strtrim($2)
TextOutBitmap > $strtrim($2) ecJOIN $bmp *** $eval($Msg_JOIN)
PlayEventSound irc_join
EndEvent
Event PART "% PART *"
if ([$nick] != [$N])
if ($isignoring($nick!$user@$host))
@l $bmp = _partign.bmp
else
@l $bmp = _part.bmp
endif
@l $nickstr = \b$_active(nick $nick) ($user@$_active(host $host))\b
@l $chanstr = $strtrim($2)
if ([$strtrim($3-)] == [])
@l $partmsgstr = $null
else
@l $partmsgstr = $null [$strtrim($3-)]
endif
TextOutBitmap > $strtrim($2) ecPART $bmp *** $eval($Msg_PART)
endif
PlayEventSound irc_part
EndEvent
Event QUIT "% QUIT *"
@l $nickstr = \b$nick ($user@$_active(host $host))\b
@l $real_quitmsgstr = $null [$strtrim($2-)]
if ($isignoring($nick!$user@$host))
@l $quitmsgstr = $null
@l $bitmap = _partign.bmp
else
@l $quitmsgstr = $real_quitmsgstr
@l $bitmap = _quit.bmp
endif
@l $the_msg = $eval($Msg_QUIT)
foreach ($i; $channellist())
if ($ison($nick $i))
TextOutBitmap > $i ecQUIT $bitmap *** $the_msg
endif
endforeach
if ($isquerying($nick))
@l $quitmsgstr = $real_quitmsgstr
TextOutBitmap > $nick ecQUIT _quit.bmp *** $eval($Msg_QUIT)
endif
PlayEventSound irc_quit
EndEvent
Event NICK "% NICK *"
@l $oldnickstr = \b$nick\b
@l $newnickstr = \b$_active(nick $strtrim($2))\b
@l $the_msg = $eval($Msg_NICK)
// don't hilite my own nick changes
if ([$nick] == [$N])
foreach ($i; $channellist())
if ($ison($nick $i))
TextOutBitmap -nohilite > $i ecNICK _nick.bmp *** $the_msg
endif
endforeach
else
foreach ($i; $channellist())
if ($ison($nick $i))
TextOutBitmap > $i ecNICK _nick.bmp *** $the_msg
endif
endforeach
endif
PlayEventSound irc_nick
EndEvent
Event PRIVMSG "% PRIVMSG *"
Halt if $isignoring($nick!$user@$host)
if ($ischannel($2))
TextOut > $2 ecChanText $_nickspacing(<\b$_active(nick $nick)\b> $strtrim($3-))
PlayEventSound irc_chantext
else if ($ischannel($nicktrim($2)))
TextOut > $nicktrim($2) ecPRIVMSG $_nickspacing(*\b$nick:$2\b* $strtrim($3-))
PlayEventSound irc_chanmsg
else if ($isquerying($nick)) || ($getsetting(usequery))
TextOut > $nick ecQueryText $_nickspacing(<\b$nick\b> $strtrim($3-))
PlayEventSound irc_querytext
_IncTrayMsgCount
else
TextOut ecPRIVMSG $_nickspacing(*\b$nick\b* $strtrim($3-))
PlayEventSound irc_msg
_IncTrayMsgCount
endif
EndEvent
Event NOTICE "% NOTICE *"
Halt if $isignoring($nick!$user@$host)
if ($ischannel($2))
TextOut > $2 ecNotice $_nickspacing(=\b$_active(nick $nick):$2\b= $strtrim($3-))
PlayEventSound irc_notice
else if ($ischannel($nicktrim($2)))
TextOut > $nicktrim($2) ecNOTICE $_nickspacing(=\b$nick:$2\b= $strtrim($3-))
PlayEventSound irc_chanmsg
else if ($isquerying($nick))
TextOut > $nick ecNotice $_nickspacing(=\b$nick\b= $strtrim($3-))
PlayEventSound irc_querytext
else if ($strpos(. $nick))
TextOut > . ecNotice $_nickspacing(=\b$nick\b= $strtrim($3-))
PlayEventSound irc_servernotice
else
TextOut ecNotice $_nickspacing(=\b$nick\b= $strtrim($3-))
PlayEventSound irc_notice
endif
EndEvent
Event CTCPAction "% PRIVMSG % :\AACTION"
Halt if $isignoring($nick!$user@$host)
if ($ischannel($2))
TextOut > $2 ecAction * \b$_active(nick $nick)\b $strtrim($4-)
PlayEventSound irc_chanact
else if ($isquerying($nick)) || ($getsetting(usequery))
TextOut > $nick ecAction * \b$nick\b $strtrim($4-)
PlayEventSound irc_querytext
else
TextOut ecAction *> \b$nick\b $strtrim($4-)
PlayEventSound irc_msg
endif
EndEvent
Event CTCP "% PRIVMSG % :\A*"
Halt if $isignoring($nick!$user@$host)
@l $ctcpstr = $upper($strtrim($3))
@l $paramstr = $4-
if ($ischannel($2))
@l $nickstr = \b$_active(nick $nick)\b
TextOut > $2 ecCTCP *** $eval($Msg_CTCP_Channel)
else
@l $nickstr = \b$nick\b
TextOut ecCTCP *** $eval($Msg_CTCP_Private)
endif
PlayEventSound irc_ctcp
EndEvent
Event RCTCP "% NOTICE % :\A*"
Halt if $isignoring($nick!$user@$host)
@l $ctcpstr = $upper($strtrim($3))
@l $nickstr = \b$nick\b
@l $paramstr = $4-
TextOut ecCTCP *** $eval($Msg_RCTCP)
PlayEventSound irc_rctcp
EndEvent
Event CTCPVersion "% PRIVMSG % :\AVERSION"
Halt if $isignoring($nick!$user@$host)
if ($LibBuild == $build)
^RCTCP $nick VERSION Visual IRC $ver ($MessageLanguage) - $Msg_CTCPVersion_Slogan http://www.visualirc.net/features.php
else
^RCTCP $nick VERSION Visual IRC $ver ($MessageLanguage) $eval($Msg_CTCPVersion_Library) - $Msg_CTCPVersion_Slogan http://www.visualirc.net/features.php
endif
FallThrough
EndEvent
Event CTCPSource "% PRIVMSG % :\ASOURCE"
Halt if $isignoring($nick!$user@$host)
^RCTCP $nick SOURCE http://www.visualirc.net/
if [${Msg_CTCPSource_Translation}] != []
^RCTCP $nick SOURCE $Msg_CTCPSource_Translation
endif
FallThrough
EndEvent
Event CTCPTime "% PRIVMSG % :\ATIME"
Halt if $isignoring($nick!$user@$host)
^RCTCP $nick TIME $time($Msg_Time_FullFormat)
FallThrough
EndEvent
Event Ping "% PRIVMSG % :\APING"
Halt if $isignoring($nick!$user@$host)
// no output
if !($strpos(+++ $4-))
^RCTCP $nick PING $4-
PlayEventSound irc_ping
endif
EndEvent
Event CTCPFinger "% PRIVMSG % :\AFINGER"
Halt if $isignoring($nick!$user@$host)
@l $idlestr = $decodeinterval($idletime())
^RCTCP $nick FINGER $eval($Msg_CTCPFinger_Reply)
FallThrough
EndEvent
Event CTCPUserInfo "% PRIVMSG % :\AUSERINFO"
Halt if $isignoring($nick!$user@$host)
@l $info = $getservsetting(userinfo)
if ([$info] == [])
@l $info = $getnetsetting(userinfo)
endif
if ([$info] == [])
@l $info = $getsetting(userinfo)
endif
^RCTCP $nick USERINFO $info
FallThrough
EndEvent
Event CTCPClientInfo "% PRIVMSG % :\ACLIENTINFO"
Halt if $isignoring($nick!$user@$host)
switch $4
case :
@l $cmdsstr = PING,TIME,VERSION,SOURCE,FINGER,USERINFO,CLIENTINFO
^RCTCP $nick CLIENTINFO :$eval($Msg_CTCPClientInfo_Help)
case PING:
^RCTCP $nick CLIENTINFO PING :$Msg_CTCPClientInfo_Ping
case TIME:
^RCTCP $nick CLIENTINFO TIME :$Msg_CTCPClientInfo_Time
case VERSION:
^RCTCP $nick CLIENTINFO VERSION :$Msg_CTCPClientInfo_Version
case SOURCE:
^RCTCP $nick CLIENTINFO SOURCE :$Msg_CTCPClientInfo_Source
case FINGER:
^RCTCP $nick CLIENTINFO FINGER :$Msg_CTCPClientInfo_Finger
case USERINFO:
^RCTCP $nick CLIENTINFO USERINFO :$Msg_CTCPClientInfo_UserInfo
case CLIENTINFO:
^RCTCP $nick CLIENTINFO CLIENTINFO :$Msg_CTCPClientInfo_ClientInfo
case else
^RCTCP $nick ERRMSG CLIENTINFO $4 :$Msg_CTCPClientInfo_Unknown
endswitch
FallThrough
EndEvent
Event PingReply "% NOTICE % :\APING"
Halt if $isignoring($nick!$user@$host)
@l $nickstr = \b$nick\b
@l $timestr = $decodepinginterval($4)
TextOut ecCTCP *** $eval($Msg_RCTCPPing)
PlayEventSound irc_rping
EndEvent
Event KICK "% KICK *"
@l $kickmsgstr = $null [$strtrim($4-)]
if !($getsetting(AutoRejoin)) && ([$3] == [$N])
@l $chanstr = \b$2\b
@l $nickstr = \b$nick\b
TextOut > . ecKICK *** $eval($Msg_KICK_Self)
else
@l $chanstr = $2
@l $nickstr = \b$_active(nick $nick)\b
@l $victimstr = \b$3\b
TextOut > $2 ecKICK *** $eval($Msg_KICK_Other)
endif
PlayEventSound irc_kick
EndEvent
Event MODE "% MODE *"
if ($ischannel($2))
@l $modestr = $_active(mode $strtrim($3-))
@l $chanstr = $2
@l $nickstr = \b$_active(nick $nick)\b
TextOutBitmap > $2 ecMODE _mode.bmp *** $eval($Msg_MODE)
PlayEventSound irc_mode
endif
EndEvent
Event ERROR "ERROR *"
TextOut > . ecERROR $Msg_Notice_Error: $strtrim($1-)
EndEvent
Event RawNotice "NOTICE *"
TextOut > . ecNotice [\b$Msg_Notice_Raw\b]\t$strtrim($1-)
PlayEventSound irc_servernotice
EndEvent
Event AuthNotice "NOTICE AUTH *"
TextOut > . ecNotice [\b$Msg_Notice_Auth\b]\t$strtrim($2-)
PlayEventSound irc_servernotice
EndEvent
Event TOPIC "% TOPIC *"
@l $nickstr = \b$_active(nick $nick)\b
@l $chanstr = $2
@l $topicstr = $strtrim($3-)
TextOutBitmap > $2 ecTOPIC _topic.bmp *** $eval($Msg_TOPIC)
PlayEventSound irc_topic
EndEvent
Event INVITE "% INVITE *"
@l $nickstr = \b$nick ($user@$_active(host $host))\b
@l $chanstr = \b$_active(invite $strtrim($3))\b
TextOut ecNotice *** $eval($Msg_INVITE)
PlayEventSound irc_invite
EndEvent
Event WALLOPS "% WALLOPS *"
TextOut > . ecNotice $_nickspacing(!\b$nick\b! $strtrim($2-))
EndEvent
// DCC <type> <filename> <encoded-ip> <port> [size] <revtoken><flags>
Event DCCRequest "% PRIVMSG % :\ADCC *"
// nuh PRIVMSG % :\ADCC SEND "filename.ext" encodedip port [length [flags]]
// 0 1 2 3 4 5 6 7 8 9
Halt if $isignoring($nick!$user@$host)
if !($ischannel($2))
@l $nohalt = 0
// new TDCC send syntax
Parse Extended $0-
if ([$4] == [SEND]) && ($strpos(T $9) != 0)
@l $word = TSEND
else
@l $word = $4
endif
EndParse
switch $word
case CHAT:
if ([$5] == [wboard])
DCC Request WBOARD $nick $user@$host $6-
@l $typestr = $Msg_DCCType_Chat
else
DCC Request CHAT $nick $user@$host $6-
@l $typestr = $Msg_DCCType_Wboard
endif
@l $nickstr = \b$nick ($user@$_active(host $host))\b
@l $addrstr = $decodeip($6):$7
TextOutBitmap ecDCC _dcc.bmp *** $eval($Msg_DCC_ChatRequest)
case SEND:
DCC Request SEND $nick $user@$host $5-
Parse Extended $5-
if ([$3] == [])
@l $len = $null
else
@l $sizestr = $3
@l $len = $eval($Msg_DCC_FileSize)
endif
@l $typestr = $Msg_DCCType_Send
@l $nickstr = \b$nick ($user@$_active(host $host))\b
@l $addrstr = $decodeip($1):$2
@l $filestr = $0$len
TextOutBitmap ecDCC _dcc.bmp *** $eval($Msg_DCC_FileRequest)
EndParse
case TSEND:
DCC Request TSEND $nick $user@$host $5-
Parse Extended $5-
@l $typestr = $Msg_DCCType_TSend
@l $nickstr = \b$nick ($user@$_active(host $host))\b
@l $addrstr = $decodeip($1):$2
@l $sizestr = $3
@l $filestr = $0$eval($Msg_DCC_FileSize)
TextOutBitmap ecDCC _dcc.bmp *** $eval($Msg_DCC_FileRequest)
EndParse
case multi RESUME,ACCEPT
// ignore - this is handled by the client
@l $nohalt = 1
case else
^RCTCP $nick ERRMSG DCC :$Msg_DCC_UnknownType
@l $typestr = DCC $upper($4)
@l $nickstr = \b$nick ($user@$_active(host $host))\b
@l $paramstr = $5-
TextOutBitmap ecDCC _dcc.bmp *** $eval($Msg_DCC_UnknownRequest)
endswitch
Halt if !($nohalt)
endif
FallThrough
EndEvent
//--------------
Event RPL_Away "% 301 *"
@l $nickstr = \b$3\b
@l $awaystr = \b$strtrim($4-)\b
if ([$WhoisTense] == [$$WhoisTense])
TextOut ecNotice *** $eval($Msg_Rpl_Away)
else
TextOut clOlive *** $eval($Msg_Rpl_Away)
endif
EndEvent
Event RPL_WhoisRegNick "% 307 *"
@l $nickstr = \b$3\b
TextOut clOlive *** $eval($Msg_Rpl_WhoisRegNick)
EndEvent
Event RPL_WhoisAdmin "% 308 *"
@l $nickstr = \b$3\b
TextOut clOlive *** $eval($Msg_Rpl_WhoisAdmin)
EndEvent
Event RPL_WhoisSAdmin "% 309 *"
@l $nickstr = \b$3\b
TextOut clOlive *** $eval($Msg_Rpl_WhoisSAdmin)
EndEvent
Event RPL_WhoisHelpOp "% 310 *"
@l $nickstr = \b$3\b
TextOut clOlive *** $eval($Msg_Rpl_WhoisHelpOp)
EndEvent
Event RPL_WhoisUser "% 311 *"
@ $WhoisTense = $Msg_WhoisTense_Is
@l $nickstr = \b$3\b
@l $uhoststr = \b$4@$_active(host $5)\b
@l $ircnamestr = $strtrim($7-)
TextOut clOlive *** $eval($Msg_Rpl_WhoisUser)
EndEvent
Event RPL_WhoisServer "% 312 *"
@l $nickstr = \b$3\b
@l $servstr = \b$4\b
@l $descstr = $strtrim($5-)
TextOut clOlive *** $eval($Msg_Rpl_WhoisServer)
EndEvent
Event RPL_WhoisOper "% 313 *"
@l $nickstr = \b$3\b
TextOut clOlive *** $eval($Msg_Rpl_WhoisOper)
EndEvent
Event RPL_WhowasUser "% 314 *"
@ $WhoisTense = $Msg_WhoisTense_Was
@l $nickstr = \b$3\b
@l $uhoststr = \b$4@$_active(host $5)\b
@l $ircnamestr = $strtrim($7-)
TextOut clOlive *** $eval($Msg_Rpl_WhowasUser)
EndEvent
Event RPL_WhoisIdle "% 317 *"
@l $nickstr = \b$3\b
@l $timestr = \b$decodeinterval($4)\b
TextOut clOlive *** $eval($Msg_Rpl_WhoisIdle)
EndEvent
Event RPL_EndOfWhois "% 318 *"
-@ $WhoisTense
EndEvent
Event RPL_WhoisChannels "% 319 *"
@l $nickstr = \b$3\b
@l $chansstr = $strtrim($4-)
TextOut clOlive *** $eval($Msg_Rpl_WhoisChannels)
EndEvent
Event RPL_Whois320 "% 320 *"
TextOut clOlive *** \b$3\b $strtrim($4-)
EndEvent
Event RPL_WhoisAccount "% 330 *"
// this event gives the services login username
@l $nickstr = \b$3\b
@l $accountstr = $strtrim($4)
TextOut clOlive *** $eval($Msg_Rpl_WhoisAccount)
EndEvent
Event RPL_WhoisRealHost "% 338 *"
// this event gives the real uhost/ip for undernet's umode +x
@l $nickstr = \b$3\b
@l $realhost = $4
@l $realip = $5
TextOut clOlive *** $eval($Msg_Rpl_WhoisRealHost)
EndEvent
Event RPL_EndOfWhowas "% 369 *"
-@ $WhoisTense
EndEvent
Event RPL_ChannelURL "% 328 *"
@l $chanstr = $3
@l $urlstr = $strtrim($4-)
TextOut > $3 ecNotice *** $eval($Msg_Rpl_ChannelURL)
EndEvent
Event RPL_NoTopic "% 331 *"
@l $chanstr = $3
TextOut > $3 ecNotice *** $eval($Msg_Rpl_NoTopic)
EndEvent
Event RPL_TopicIs "% 332 *"
@l $chanstr = $3
@l $topicstr = $strtrim($4-)
TextOut > $3 ecNotice *** $eval($Msg_Rpl_TopicIs)
EndEvent
Event RPL_TopicSetBy "% 333 *"
@l $nickstr = \b$4\b
@l $timestr = \b$unixtime($5 $Msg_Time_LongFormat)\b
TextOut > $3 ecNotice *** Topic set by \b$4\b on \b$unixtime($5 ddd mmm d h:nn ampm)\b
EndEvent
Event RPL_LusersUserCount "% 251 *"
TextOut > . ecNotice *** $strtrim($3-)
EndEvent
Event RPL_LusersOperCount "% 252 *"
TextOut > . ecNotice *** $3 $strtrim($4-)
EndEvent
Event RPL_LusersUnknownConn "% 253 *"
TextOut > . ecNotice *** $3 $strtrim($4-)
EndEvent
Event RPL_LusersChanCount "% 254 *"
TextOut > . ecNotice *** $3 $strtrim($4-)
EndEvent
Event RPL_LusersConnCount "% 255 *"
TextOut > . ecNotice *** $strtrim($3-)
EndEvent
Event RPL_LusersLocalUsers "% 265 *"
TextOut > . ecNotice *** $strtrim($3-)
EndEvent
Event RPL_LusersGlobalUsers "% 266 *"
TextOut > . ecNotice *** $strtrim($3-)
EndEvent
//--------------
Event ERR_NoSuchNick "% 401 *"
@l $nickstr = \b$3\b
TextOut ecError *** $eval($Msg_Err_NoSuchNick)
EndEvent
Event ERR_NoSuchServer "% 402 *"
@l $serverstr = \b$3\b
TextOut ecError *** $eval($Msg_Err_NoSuchServer)
EndEvent
Event ERR_WasNoSuchNick "% 406 *"
@l $nickstr = \b$3\b
TextOut ecError *** $eval($Msg_Err_WasNoSuchNick)
EndEvent
Event ERR_UnknownCommand "% 421 *"
@l $cmdstr = $3
TextOut ecError *** $eval($Msg_Err_UnknownCommand)
EndEvent
Event ERR_NicknameInUse "% 433 *"
@l $nickstr = \b$3\b
TextOut ecError *** $eval($Msg_Err_NicknameInUse)
EndEvent
Event ERR_BanNickChange "% 437 *"
@l $chanstr = $3
TextOut ecError *** $eval($Msg_Err_BanNickChange)
EndEvent
Event ERR_NChangeTooFast "% 438 *"
TextOut ecError *** $strtrim($4-)
EndEvent
Event ERR_ServicesDown "% 440 *"
TextOut ecError *** $Msg_Err_ServicesDown
EndEvent
Event ERR_NeedReggedNick "% 477 *"
@l $chanstr = \b$3\b
TextOut ecError *** $eval($Msg_Err_NeedReggedNick)
EndEvent
Event ERR_BanListFull "% 478 *"
@l $chanstr = \b$3\b
TextOut ecError *** $eval($Msg_Err_BanListFull)
EndEvent
Event ERR_UserNotInChannel "% 441 *"
@l $nickstr = $3
@l $chanstr = $4
TextOut > $4,. ecError *** $eval($Msg_Err_UserNotInChannel)
EndEvent
Event ERR_NotOnChannel "% 442 *"
@l $chanstr = $3
TextOut > $3,. ecError *** $eval($Msg_Err_NotOnChannel)
EndEvent
Event ERR_ChannelIsFull "% 471 *"
@l $chanstr = $3
TextOut > $3,. ecError *** $eval($Msg_Err_ChannelIsFull)
EndEvent
Event ERR_InviteOnlyChan "% 473 *"
@l $chanstr = $3
TextOut > $3,. ecError *** $eval($Msg_Err_InviteOnlyChan)
EndEvent
Event ERR_BannedFromChan "% 474 *"
@l $chanstr = $3
TextOut > $3,. ecError *** $eval($Msg_Err_BannedFromChan)
EndEvent
Event ERR_BadChannelKey "% 475 *"
@l $chanstr = $3
TextOut > $3,. ecError *** $eval($Msg_Err_BadChannelKey)
EndEvent
Event ERR_ChanOPrivsNeeded "% 482 *"
@l $chanstr = $3
TextOut > $3,. ecError *** $eval($Msg_Err_ChanOPrivsNeeded)
EndEvent
//--------------
Event <default> "*"
if ($getsetting(showraw))
TextOut > . ecServText $0-
else
TextOut > . ecServText $strtrim($3-)
endif
EndEvent
Event StartMOTD "% 375 *"
TextOut > . ecServText \f$strtrim($3-)
EndEvent
Event MOTD "% 372 *"
TextOut > . ecServText \f$strtrim($3-)
EndEvent
Event EndMOTD "% 376 *"
TextOut > . ecServText \f$strtrim($3-)
EndEvent
//--------------
// read 005 numeric for server capabilities
Event RPL_ServerCaps -after "% 005 *"
@l $caps = $listfromwords($3-)
foreach ($i; $caps)
@l $name = $strtokl(= $i)
@l $value = $strtokr(= $i)
switch $name
case PREFIX:
// $value = (ohv)@%+
// add any new modes to NLX
@l $rparen = )
@l $modechars = $strtokl($rparen $value)
if [$substr($modechars 1 1)] == [(]
@l $modechars = $substr($modechars 2 99)
endif
@l $namesmarks = $strtokr($rparen $value)
@l $cnt = $length($modechars)
if $length($namesmarks) < $cnt
@l $cnt = $length($namesmarks)
endif
for (@l $i = 1; $i <= $cnt; $i++)
@l $mc = $substr($modechars $i 1)
if [$nlflaginfo($mc)] == []
^NLAddFlag $mc $substr($namesmarks $i 1)
TextOut > . ecScript *** Added nick list flag +$mc
endif
endfor
endswitch
endforeach
EndEvent
//--------------
// support for TMS tables
Event <OnCreateWindow_inittables> "*"
if [$0] == [TDCCChatForm]
// use the unique name
@l $win = $2
else
@l $win = $1
endif
if !$InitializedTables
// channel text table
TextOut > $win clBlack \S@td/w:chantext:12ch:?\S
// timer list table
TextOut > $win clBlack \S@td/w:timers:2ch:8ch:10ch:3ch:?\S
@ $InitializedTables = 1
endif
// set default table
TextOut > $win clBlack \S@setdeft:chantext\S
EndEvent
Alias _NICKSPACING
// 0=space, 1=tab, 2=table
switch $getsetting(nickspacing)
case 0:
@ $fresult = $1 $2-
case 1:
@ $fresult = $1\t$2-
case 2:
@ $fresult = \S@col\S$1\S@col\S$2-
endswitch
EndAlias
// show the timers in a nice table format
Alias TIMERS
if [$1] == [all]
@l $sid = $null
else
@l $sid = $currentserver()
endif
TextOut > $C clBlack \S@pusht:timers\S
TextOut > $C ecScript \b\u\S@col\S$Msg_Timers_Svr\S@col\S$Msg_Timers_Name\S@col\S$Msg_Timers_Interval\S@col\S$Msg_Timers_Rpt\S@col\S$Msg_Timers_Command\u\b
@l $list = $timerlist($sid)
// server ID : timer name : interval : repeats : command
foreach ($i; $list)
@l $info = $gettimer($i)
@l $id = $gettimerserver($i)
Parse $info
// $0=interval (ms), $1=repeats, $2- = command
if $0 % 1000 == 0
@l $interval = $($0 / 1000) $Msg_Time_sec
else
@l $interval = $0 $Msg_Time_ms
endif
TextOut > $C ecScript \S@col\S$id\S@col\S$i\S@col\S$interval\S@col\S$1\S@col\S$2-
EndParse
endforeach
TextOut > $C ecScript \S@popt\S$Msg_List_End
EndAlias
//--------------
// output for built-in commands
// these get the target in $0 and the text in $1-
Event <OnMyChanText> "*"
TextOut > $C ecMyChanText $_nickspacing([\b$N\b] $1-)
EndEvent
Event <OnMyPrivMsg> "*"
TextOut > $C ecPRIVMSG -> $_nickspacing(*\b$0\b* $1-)
EndEvent
Event <OnMyNotice> "*"
TextOut > $C ecNotice -> $_nickspacing(=\b$0\b= $1-)
EndEvent
Event <OnMyCTCP> "*"
TextOut > $C ecCTCP -> $_nickspacing({\b$0\b} CTCP $1-)
EndEvent
Event <OnMyRCTCP> "*"
TextOut > $C ecCTCP -> $_nickspacing({\b$0\b} RCTCP $1-)
EndEvent
Event <OnMyChanAction> "*"
TextOut > $C ecAction * \b$N\b $1-
EndEvent
Event <OnMyPrivAction> "*"
TextOut > $C ecAction -> \b$0\b\t*> \b$N\b $1-
EndEvent
Event <OnMyQueryText> "*"
TextOut > $C ecMyQueryText $_nickspacing([\b$N\b] $1-)
EndEvent
Event <OnMyQueryAction> "*"
TextOut > $C ecAction * \b$N\b $1-
EndEvent
// <OnNewDCCChatText> events get the nick in $0, the window name in $1,
// and the text in $2-.
Event <OnNewDCCChatText_Action> "% % \AACTION"
TextOut > $1 ecAction * \b$nick\b $strtrim($3-)
PlayEventSound dcc_chattext
EndEvent
Event <OnNewDCCChatText_Chat> "*"
TextOut > $1 ecQueryText $_nickspacing(<\b$nick\b> $2-)
PlayEventSound dcc_chattext
EndEvent
Event <OnDCCChatClosed> "*"
TextOut > $1 ecDCC *** $Msg_DCC_ClosedByRemote
EndEvent
// <OnDCCRequest> event is run when a DCC request is added to the list (with
// the DCC Request command). the event can respond with DCC Accept [filename],
// DCC Resume <size> [filename], or DCC Reject.. or do nothing to leave it in
// the list. if filename is omitted, the default filename is used.
Event <OnDCCRequest_sound> "*"
PlayEventSound virc_dcc
EndEvent
Event <OnDCCRequest> "*"
// params: :n!u@h type(CHAT,SEND,TSEND) ip port size filename
@l $ext = $rstrtokr(. $5-)
if ($getsetting(dccautoacceptchat)) && ([$1] == [CHAT])
// accept all chats
DCC Accept
else if ($getsetting(dccautoacceptsend)) && (([$1] == [SEND]) || ([$1] == [TSEND]))
// leave in DCC list if it's a dangerous extension
if ($isinset([$ext] [$getsetting(dccwarnexts)]))
// show the dialog for 5 minutes, then hide it
@l $nickstr = $nick ($user@$host)
@l $filestr = $5-
@l $extstr = $ext
@l $warndlg = $new(TMessageDialog $eval($Msg_DCC_AutoWarnExtDialog) mtWarning [mbYes,mbNo])
^Delay dcc_warndlg_$warndlg 300 @p $warndlg.ModalResult = 7
try
@l $result = $warndlg.ShowModal()
// 6 = Yes, 7 = No
Halt if $result == 7
^UnDelay dcc_warndlg_$warndlg
finally
SafeDestroy $warndlg
endtry
^UnDelay dcc_warndlg_$warndlg
endif
// does the file already exist?
@l $fn = $getpath(download)$5-
if ($fileexists($fn))
// yes.. if our copy is smaller and this isn't a dangerous extension,
// resume. otherwise pick a new filename.
if ($getsetting(dccautoresume)) && ($getfilesize($fn) < $4) && ($isinset([$ext] [$getsetting(dccwarnexts)]) == 0)
DCC Resume $getfilesize($fn) $fn
else
@l $i = 1
while 1
break if !($fileexists($getpath(download)$i $5-))
$i++
endwhile
DCC Accept $getpath(download)$i $5-
endif
else
DCC Accept $fn
endif
else
if ($isinset([$ext] [$getsetting(dccwarnexts)]))
@l $nickstr = $nick ($user@$host)
@l $filestr = $5-
@l $extstr = $ext
@l $msg = $eval($Msg_DCC_WarnExtDialog)
if ($messagedlg(52 $msg) != 6)
DCC Reject
endif
endif
endif
EndEvent
//--------------
Event <OnNotifyJoin> "*"
@l $nickstr = $0
@l $msg = $eval($Msg_Notify_Join)
TextOut > . ecNotice *** $msg
if ($isquerying($0))
TextOut > $0 ecNotice *** $msg
endif
PlayEventSound notify_join
EndEvent
Event <OnNotifyQuit> "*"
@l $nickstr = $0
@l $msg = $eval($Msg_Notify_Quit)
TextOut > . ecNotice *** $msg
if ($isquerying($0))
TextOut > $0 ecNotice *** $msg
endif
PlayEventSound notify_quit
EndEvent
Event <OnConnect_firehooks> "*"
foreach ($i; $arrayvalues($ConnectHooks))
$i
endforeach
@ $ConnectHooks = $null
EndEvent
Alias _RunAutoPerform
halt if [$1-] == []
@l $TS = $new(TStringList)
foreach ($i; $1-)
$TS.Add $i
endforeach
$TS.Execute
Destroy $TS
EndAlias
Alias ShiftKeys_Active
// ignore shift keys if ViRC isn't the active application
@l $obj = $mapobject(!Application)
if [$prop($obj.Active)] == [False]
@ $fresult = []
else
@ $fresult = $shiftkeys()
endif
UnmapObject $obj
EndAlias
Event <OnConnect_virclib> "*"
PlayEventSound virc_connect
@l $umode = $getservsetting(defumode)
if ([$umode] == [])
@l $umode = $getnetsetting(defumode)
endif
if ([$umode] == [])
@l $umode = $getsetting(defumode)
endif
if ([$umode] != [])
Umode $umode
endif
// start keepalive timer
^Timer keepalive_$getwindowid(.) 300 0 eval raw -idle PONG :$$server
// autoperform comes before autojoin
_RunAutoPerform $getnetsetting(autoperform)
_RunAutoPerform $getservsetting(autoperform)
if !($isinset([shift] $shiftkeys_active()))
@l $autojoin = $getservsetting(autojoin)
if ([$autojoin] == [])
@l $autojoin = $getnetsetting(autojoin)
endif
if ([$autojoin] == [])
@l $autojoin = $getsetting(autojoin)
endif
if ([$autojoin] != [])
Join $autojoin
if ($getsetting(hideonautojoin))
Hide .
endif
endif
endif
EndEvent
Event <OnDisconnect_virclib> "*"
PlayEventSound virc_disconnect
EndEvent
//--------------
Alias J
if ([$1] == [])
@l $list = $?="$Msg_J_ChanPrompt"
Halt if [$list] == [INPUT_CANCELLED]
else
@l $list = $1-
endif
foreach ($x; $list)
if !($ischannel($x))
@l $x = #$x
endif
Join $x
endforeach
EndAlias
Alias WI
Whois $1-
EndAlias
Alias WW
Whowas $1-
EndAlias
Alias SV
Say [ViRC $ver ($build/$exebuild), virc.lib $LibVersion]
EndAlias
Alias DECODEPINGINTERVAL
@ $fresult = $decodeminterval($($mtime() - $1))
EndAlias
Alias WALL
if ($ischannel($1))
@l $chan = $1
@l $msg = $2-
else
@l $chan = $C
@l $msg = $1-
endif
// prefer @#chan, then multinicks, then individual messages (ack)
@l $omsg = [\bOps\b:\b$chan\b] $msg
if ($getservsetting(atchan))
^Notice @$chan $omsg
else if ($getservsetting(multinicks))
foreach ($a,$b,$c,$d,$e,$f,$g,$h,$i; $listremove($N $oplist($chan)))
^Notice $a,$b,$c,$d,$e,$f,$g,$h,$i $omsg
endforeach
else
foreach ($i; $listremove($N $oplist($chan)))
^Notice $i $omsg
endforeach
endif
TextOut > $chan ecNotice -> [\bOps\b:\b$chan\b]\t$msg
EndAlias
Alias WHO
// override the built-in command to use windowed /who instead
WindowedWho $1-
EndAlias
Alias ONALL
@l $cnt = $listelementcount($serverlist())
// 0 is the global interpreter
for (@l $i = 1; $i < $cnt; $i++)
OnServer $i $1-
endfor
EndAlias
Alias AASAY
OnAll ASay $1-
EndAlias
Alias AAME
OnAll AMe $1-
EndAlias
Alias CHATOPS
Raw CHATOPS :$1-
EndAlias
Alias GLOBOPS
Raw GLOBOPS :$1-
EndAlias
Alias SQUERY
TextOut ecPRIVMSG -> $_nickspacing(**\b$1\b** $2-)
Raw SQUERY $1 :$2-
EndAlias
//--------------
Alias ISIGNORING
@ $fresult = $($getuserfield($1 ignore) != 0)
EndAlias
Alias ISIGNORINGNICK
@ $fresult = $isignoring($1!$getaddress($1))
EndAlias
Alias _IGNMASK
switch $1
case matches *!*@*
@ $fresult = $@
case matches *@*
@ $fresult = $uhosttomask($@)
case else
@ $fresult = $nicktomask($@)
endswitch
EndAlias
Alias IGNORE
@l $mask = $_ignmask($1)
SetUserField $mask ignore 1
@l $maskstr = $mask
TextOut ecScript *** $eval($Msg_Ignore_Start)
EndAlias
Alias UNIGNORE
@l $mask = $_ignmask($1)
@l $maskstr = $mask
if !($isignoring($mask))
TextOut ecError *** $eval($Msg_Ignore_NotIgnoring)
else
DelUserField $mask ignore
TextOut ecScript *** $eval($Msg_Ignore_End)
endif
EndAlias
Alias IGNORES
TextOut ecScript $Msg_Ignore_ListStart
foreach ($a,$b,$c; $userfieldlist(ignore))
TextOut ecScript $a $b $c
endforeach
TextOut ecScript $Msg_List_End
EndAlias
//--------------
// Handle irc:// URLs
// Windows sends /irchyperlink <url> through DDE when a link to an IRC server
// is activated. The format is irc://<server>[:port][/[channel]]
Alias IRCHYPERLINK
@l $url = $1-
// strip irc://
@l $url = $strtokr(// $url)
// strip trailing /
while [$substr($url $length($url) 1)] == [/]
@l $url = $substr($url 1 $($length($url) - 1))
endwhile
// contains a channel?
@l $chan = $rstrtokr(/ $url)
@l $host = $rstrtokl(/ $url)
@l $hostmask = $host
if $strpos(: $host) == 0
@l $hostmask = $host:*
@l $host = $host:6667
endif
if ([$chan] != []) && (!$ischannel($chan))
@l $chan = #$chan
endif
// a link to a channel? already connected to the right server?
if [$chan] != []
@l $id = 1
foreach ($i; $listdelete(0 $serverlist()))
if $globmatch($i $hostmask) || $globmatch($onserver($id $$serverhost()) $hostmask)
OnServer $id join $chan
Halt
endif
$id++
endforeach
endif
// no, open a server window and connect it
OnServer $newserverwindow($host) _IRCHYPERLINK2 $chan
EndAlias
Alias _IRCHYPERLINK2
if [$1] != []
@l $chan = $1
@ $ConnectHooks[irchyperlink] = join $1
endif
Connect
EndAlias
//--------------
// Automatic event chaining!
// Add a handler, replacing any existing one with the same ID:
// @e+ <obj.prop> = <handler_id>, <handler_code>
// Remove a handler:
// @e- <obj.prop> = <handler_id>
// List event handlers:
// foreach ($id,$code; $eventhandlers(<obj.prop>)
// MessageBox id=$id, code=$code
// endforeach
// // or use it as an array...
// @l $handler_array = $eventhandlers(<obj.prop>)
// MessageBox default handler is $handler_array[default]
Alias @E+
// @e+ $obj.Prop = id, handler
// aliases beginning with @ don't have their parameters evaluated
@l $objprop = $strtrim($upeval($strtokl(= $1-)))
@l $rest = $strtokr(= $1-)
@l $id = $strtrim($upeval($strtokl(, $rest)))
@l $handler = $strtokr(, $rest)
if $strpos($$ $handler) || $strpos(\ $handler)
// needs to be evaluated before firing
@l $handler = Eval $handler
endif
// get current handler
@l $curhandler = $prop($objprop)
// already a multi-handler?
Parse $curhandler
switch $0
case MULTI_HANDLER:
// add to handler array
@l $harray = $1-
@l $harray[$id] = $handler
case multi NIL,NOP
// just set handler
@l $harray = $listquote($id) $listquote($handler)
case else
// set default + handler
@l $harray = default $listquote($curhandler) $listquote($id) $listquote($handler)
endswitch
EndParse
// set new multi-handler
@p $objprop = MULTI_HANDLER $harray
EndAlias
Alias @E-
// @e- $obj.Prop = id
@l $objprop = $strtrim($upeval($strtokl(= $1-)))
@l $id = $strtrim($upeval($strtokr(= $1-)))
// get current handler
@l $curhandler = $prop($objprop)
// is it a multi-handler?
Parse $curhandler
if [$0] == [MULTI_HANDLER]
// get handler array
@l $harray = $1-
// delete handler
-@l $harray[$id]
// set new handler
@p $objprop = MULTI_HANDLER $harray
endif
EndParse
EndAlias
Alias EVENTHANDLERS
@l $curhandler = $prop($1-)
// is it a multi-handler?
Parse $curhandler
switch $0
case MULTI_HANDLER:
// dump handler array
@ $fresult = $1-
case multi NIL,NOP
// no handler
@ $fresult = $null
case else
// single handler
@ $fresult = default $listquote($curhandler)
endswitch
EndParse
EndAlias
Alias MULTI_HANDLER
// multi_handler "id1" "code1" "id2" "code2"...
// have to be careful with local variables since all the handlers
// will have access to them...
foreach ($__id__,$__handler__; $1-)
Chain $__handler__
endforeach
EndAlias
//--------------
Alias _ACTIVE
if ($getsetting(active$1))
@ $fresult = \S$1:$2-\S
else
@ $fresult = $2-
endif
EndAlias
// Active nicks
Alias CLICK_nick
if ([$Button] == [mbRight])
@ $ANServer = $currentserver()
@ $ANChan = $C
@ $ANPerson = $Text
$ANPopup.Popup $ScreenX $ScreenY
endif
EndAlias
// Active hosts
Alias CLICK_host
if ([$1] == [double])
DNS *$Text
endif
EndAlias
// Active modes
Alias CLICK_mode
if ([$Button] == [mbRight])
@ $AMServer = $currentserver()
@ $AMChan = $C
@ $AMMode = $Text
@p $AMReverseItem.Enabled = $isop($N $C)
$AMPopup.Popup $ScreenX $ScreenY
endif
EndAlias
Alias _AM_REVERSE_CLICK
@l $out = $null
Parse $AMMode
for (@l $i = 1; $i <= $length($0); $i++)
switch $substr($0 $i 1)
case +:
@l $out = ${out}-
case -:
@l $out = ${out}+
case else
@l $out = $out$@
endswitch
endfor
Mode $AMChan $out $1-
EndParse
EndAlias
// Active invites
Alias CLICK_invite
if ([$1] == [double])
Join $Text
endif
EndAlias
Alias INITACTIVEPOPUPS
if ([$ANPopup] != [$$ANPopup])
Destroy $ANPopup
endif
@ $ANPopup = $new(TPopupMenu)
$ANPopup.LoadFromMenuTree MT_CHANNELNICKSPOPUP
@l $ts = $new(TStringList)
$ts.GetMenuItemList MT_CHANNELNICKSPOPUP
for (@l $i = 0; $i < $prop($ts.Count); $i++)
@l $x = $ts.GetString($i)
continue if !$isobject($_item.$x)
@p $_item.$x.Hint = $getmenuhint($x on MT_CHANNELNICKSPOPUP)
@p $_item.$x.OnClick = Eval OnServer $$ANServer FireMenuItem > $$ANChan $x on MT_CHANNELNICKSPOPUP = $$ANPerson
endfor
Destroy $ts
if ([$AMPopup] != [$$AMPopup])
Destroy $AMPopup
endif
@ $AMPopup = $new(TPopupMenu)
@ $AMReverseItem = $new(TMenuItem ownedby $AMPopup)
@p $AMReverseItem.Caption = $Msg_Active_ReverseCaption
@p $AMReverseItem.Hint = $Msg_Active_ReverseHint
@p $AMReverseItem.OnClick = Eval OnServer $$AMServer _AM_REVERSE_CLICK
$AMPopup.Items.Add $AMReverseItem
EndAlias
//--------------
// Hyperlink right-click popup
With > localized_menutree MT_HYPERPOPUP
M_GOTOURL <none> 0 0 @@Msg_Active_GotoLinkCaption
M_NEWWIN <none> 0 0 @@Msg_Active_LinkNewCaption
M_SEP1 <none> 0 0 -
M_COPYURL <none> 0 0 @@Msg_Active_CopyLinkCaption
EndWith
Alias INITHYPERPOPUP
if [$HyperPopup] != [$$HyperPopup]
Destroy $HyperPopup
endif
@ $HyperPopup = $new(TPopupMenu)
$HyperPopup.LoadFromMenuTree MT_HYPERPOPUP
@p $_item.M_GOTOURL.Default = True
@p $_item.M_GOTOURL.Hint = $Msg_Active_GotoLinkHint
@e $_item.M_GOTOURL.OnClick = WebHyperlink $HPLink
@p $_item.M_COPYURL.Hint = $Msg_Active_CopyLinkHint
@e $_item.M_COPYURL.OnClick = SetClipboard $HPLink
@p $_item.M_NEWWIN.Hint = $Msg_Active_LinkNewHint
@e $_item.M_NEWWIN.OnClick = Exec iexplore $HPLink
EndAlias
Alias _HYPER_POPUP
@ $HPLink = $Text
$HyperPopup.Popup $ScreenX $ScreenY
EndAlias
Event <OnCreateWindow_hyperpopup> "*"
@l $output = $mapobject($1:Output)
@e+ $output.OnHyperlinkPopup = virclib, _hyper_popup
UnmapObject $output
EndEvent
//--------------
// Status window
Event <OnUserSetupOK_statuswindow> "*"
if $isobject($statusWindow)
@p $statusWindow.Background = ecBackground
@l $font = $parsefont($getsetting(Fonts Main))
@p $statusWindow.Font.Name = $font[name]
@p $statusWindow.Font.Size = $font[size]
endif
EndEvent
Alias PARSEFONT
// $parsefont(Font Name <size> ["[style]"])
@l $str = $1-
@l $temp = $null
@l $temp[style] = $rstrtokrex(" " $str)
@l $str = $rstrtoklex(" " $str)
if $isnumeric($temp[style])
@l $temp[size] = $temp[style]
@l $temp[style] = $null
@l $temp[name] = $str
else
@l $temp[size] = $rstrtokrex(" " $str)
@l $temp[name] = $rstrtoklex(" " $str)
endif
@ $fresult = $temp
EndAlias
Alias INPUTDEFAULT
@l $prompt = $strtokl(| $1-)
@l $default = $strtokr(| $1-)
@l $result = $?="$prompt|$default"
if [$result] == [INPUT_CANCELLED]
@l $result = $default
endif
@ $fresult = $result
EndAlias
Alias SHOWSTATUSWINDOW
if ($currentserver() != 0)
OnServer 0 ShowStatusWindow
Halt
endif
// show the tab bar first
@l $tabbar = $mapobject(!Main:TabBar)
@p $tabbar.Visible = True
UnmapObject $tabbar
if ($isobject($statusWindow))
@l $wasvisible = $prop($statusWindow.Visible)
Destroy $statusWindow
Destroy $statusPopup
else
@l $wasvisible = True
endif
@ $statusWindow = $new(TMonkeyScroller ownedby 0 position 0,$($prop(0.ClientHeight) - 140),$($prop(0.ClientWidth) - 30),63)
@p $statusWindow.Align = alBottom
@p $statusWindow.ScrollBars = ssVertical
@p $statusWindow.Background = ecBackground
@l $font = $parsefont($getsetting(Fonts Main))
@p $statusWindow.Font.Name = $font[name]
@p $statusWindow.Font.Size = $font[size]
@p $statusWindow.Visible = $wasvisible
@p $statusWindow.OnCopyText = _status_copytext
@e $statusWindow.OnScriptLink = _status_scriptlink
@e $statusWindow.OnHyperlinkPopup = _hyper_popup
@ $statusPopup = $new(TPopupMenu)
@p $statusWindow.PopupMenu = $statusPopup
@l $item = $new(TMenuItem ownedby $statusPopup)
@p $item.Caption = $Msg_Status_ClearCaption
@p $item.OnClick = Clear %$statusWindow
$statusPopup.Items.Add $item
@l $item = $new(TMenuItem ownedby $statusPopup)
@p $item.Caption = $Msg_Status_BufSizeCaption
// @E causes the function calls to be evaluated when the menu item is clicked
@e $item.OnClick = @p $statusWindow.BufferSize = $inputdefault(Enter new buffer size:|$prop($statusWindow.BufferSize))
$statusPopup.Items.Add $item
@l $item = $new(TMenuItem ownedby $statusPopup)
@p $item.Caption = $Msg_Status_HideCaption
@p $item.OnClick = DisableStatus
$statusPopup.Items.Add $item
// let other scripts change the status window
FireEvent <OnCreateStatusWindow* $statusWindow $statusPopup
// change enabledness of 'show/hide status window' menu items
UpdateMainMenu
EndAlias
Alias TOS
if !($isobject($statusWindow))
ShowStatusWindow
endif
if ([$2] == [***])
@l $msg = [$time(hh:nn)] $3-
else
@l $msg = [$time(hh:nn)] $2-
endif
*TextOut > %$statusWindow $1 $msg
@ $LastStatus = $msg
EndAlias
Alias TEXTOUT
// redirect textouts to the status window
if ([$1] != [>]) && ([$2] == [***])
// automatically show status window if necessary
if ($isobject($statusWindow))
if ([$prop($statusWindow.Visible)] == [False]) && ($getsetting(autoshowstatus))
EnableStatus
endif
else if ($getsetting(autoshowstatus))
ShowStatusWindow
endif
if ($isobject($statusWindow)) && ([$prop($statusWindow.Visible)] == [True])
TOS $1-
else
*TextOut $1-
endif
else
*TextOut $1-
endif
EndAlias
Alias _STATUS_MOUSEUP
@l $txt = $prop($Sender.SelText)
if ([$txt] != [])
@l $nt = $listjoin($char(13)$char(10) $listsplit($char(10) $txt))
SetClipboard $nt
@p $Sender.SelLength = 0
endif
EndAlias
Alias _STATUS_COPYTEXT
if ([$Text] != [])
@l $nt = $listjoin($char(13)$char(10) $listsplit($char(10) $Text))
SetClipboard $nt
endif
EndAlias
Alias _STATUS_SCRIPTLINK
if $isinset([ssDouble] $Shift)
@l $x = double
else
@l $x = single
endif
@ $_Status_SL_Cmd = CLICK_$Command $x $Text
@l $TS = $new(TStringList)
$TS.Add @l $$Button = $Button
$TS.Add @l $$Text = $Text
$TS.Add @l $$C = .
$TS.Add @l $$X = $X
$TS.Add @l $$Y = $Y
$TS.Add @l $$ScreenX = $ScreenX
$TS.Add @l $$ScreenY = $ScreenY
$TS.Add Chain $$_Status_SL_Cmd
OnServer $activeserver() $TS.Execute
Destroy $TS
EndAlias
Alias RLS
if ([$LastStatus] != [$$LastStatus])
Say $LastStatus
endif
EndAlias
Alias ENABLESTATUS
if ($isobject($statusWindow))
@p $statusWindow.Visible = True
UpdateMainMenu
else
ShowStatusWindow
endif
EndAlias
Alias DISABLESTATUS
if ($isobject($statusWindow))
@p $statusWindow.Visible = False
UpdateMainMenu
endif
EndAlias
Alias ISSTATUSVISIBLE
if ($isobject($statusWindow))
@ $fresult = $([$prop($statusWindow.Visible)] == [True])
else
@ $fresult = 0
endif
EndAlias
//--------------
Alias INITCLOCKLABEL
// do neat stuff
Class TClockLabel
Private Property Timer
Private Property Label
Private Property Owner
Property Top write SetRelay
Property Left write SetRelay
Property Width write SetRelay
Property Height write SetRelay
Property Visible write SetRelay
Property OnClick write SetRelay
Property Enabled write SetEnabled read GetEnabled
Private Method <Create>
@l $pos = $null
@l $labclass = TLabel
foreach ($i,$j; $1-)
switch $i
case ownedby:
@p $Self.Owner = $j
case position:
@l $pos = $j
case labelclass:
@l $labclass = $j
endswitch
endforeach
if ([$pos] != [])
@p $Self.Label = $new($labclass ownedby $prop($Self.Owner) position $pos)
else
@p $Self.Label = $new($labclass ownedby $prop($Self.Owner))
endif
@l $timer = $new(TTimer)
@p $Self.Timer = $timer
@p $timer.Interval = 250
@p $timer.OnTimer = $Self.Timer_Tick
@p $timer.Enabled = True
foreach ($i; Top Left Width Height Visible OnClick)
@p $Self.$i = $prop($prop($Self.Label).$i)
endforeach
EndMethod
Private Method <Destroy>
Destroy $prop($Self.Label)
Destroy $prop($Self.Timer)
EndMethod
Private Method Timer_Tick
@p $prop($Self.Label).Caption = $time()
EndMethod
Private Method SetRelay
@p $prop($Self.Label).$1 = $2-
@p $Self.$1 = $prop($prop($Self.Label).$1)
EndMethod
Private Method SetEnabled
@p $prop($Self.Timer).Enabled = $2-
EndMethod
Private Method GetEnabled
@ $fresult = $prop($prop($Self.Timer).Enabled)
EndMethod
EndClass
EndAlias
//--------------
Event <OnCacheBitmaps_virclib> "*"
// replace built-in _join.bmp, etc. with those found in the image path
@l $bmps = _join.bmp _part.bmp _joinign.bmp _partign.bmp _quit.bmp _nick.bmp _mode.bmp _topic.bmp _dcc.bmp
foreach ($i; $listfromwords($bmps))
if $fileexists($getpath(image)$i)
CacheBitmap $i $bitmap($getpath(image)$i)
endif
endforeach
EndEvent
Event <OnStart_cachebitmaps> "*"
// hook into the config form to grab the old image path
@l $setup = $mapobject(!UserSetup)
@e+ $setup.OnShow = cachebitmaps, @ $OldImagePath = $getpath(image)
UnmapObject $setup
EndEvent
Event <OnUserSetupOK_cachebitmaps> "*"
if [$getpath(image)] != [$OldImagePath]
FlushBitmapCache
endif
EndEvent
//--------------
Alias _ALLSCRIPTS
@ $fresult = $listcat($listquote($getsetting(ScriptFile)) $listquote($getsetting(Scripts LocalScript)) $getsetting(Scripts AddOn))
EndAlias
Event <OnStart_autorehash> "*"
// hook into the config form to grab the old script list
@l $setup = $mapobject(!UserSetup)
@e+ $setup.OnShow = autorehash1, @ $OldScriptList = $_allscripts()
@e+ $setup.OnShow = autorehash2, @ $OldScriptPath = $getpath(script)
UnmapObject $setup
EndEvent
Event <OnUserSetupOK_autorehash> "*"
if ([$_allscripts()] != [$OldScriptList]) || ([$getpath(script)] != [$OldScriptPath])
Rehash
endif
EndEvent
//--------------
Event <OnStart_virclib> "*"
# InitClockLabel
# @l $about = $mapobject(!About)
# @ $clocklabel = $new(TClockLabel ownedby $about position 184,152,64,16)
# UnmapObject $about
# @p $clocklabel.OnClick = Beep
if ($build != $LibBuild)
@l $obj = $mapobject(!About:VersionLabel)
@p $obj.Caption = $prop($obj.Caption) / virc.lib $LibVersion
UnmapObject $obj
endif
AddScriptControl config edit "$Msg_SS_defumode" defumode = +i
AddScriptControl config edit "$Msg_SS_autojoin" autojoin
AddScriptControl config edit "$Msg_SS_userinfo" userinfo
AddScriptControl network edit "$Msg_SS_defumode" defumode
AddScriptControl network edit "$Msg_SS_autojoin" autojoin
AddScriptControl network edit "$Msg_SS_userinfo" userinfo
AddScriptControl network codeedit "$Msg_SS_autoperform" autoperform
AddScriptControl server edit "$Msg_SS_defumode" defumode
AddScriptControl server edit "$Msg_SS_autojoin" autojoin
AddScriptControl server edit "$Msg_SS_userinfo" userinfo
AddScriptControl server codeedit "$Msg_SS_autoperform" autoperform
AddScriptControl config edit "$Msg_SS_autoconnect" autoconnect
AddScriptControl config check "$Msg_SS_hideonautojoin" hideonautojoin = 1
AddScriptControl config check "$Msg_SS_usequery" usequery = 1
AddScriptControl config check "$Msg_SS_showraw" showraw = 0
AddScriptControl config check "$Msg_SS_autoshowstatus" autoshowstatus = 0
AddScriptControl config radio "$Msg_SS_nickspacing" nickspacing "$Msg_SS_nickspacing_space" "$Msg_SS_nickspacing_tab" "$Msg_SS_nickspacing_table" = 2
AddScriptControl config check "$Msg_SS_activenick" activenick = 1
AddScriptControl config check "$Msg_SS_activehost" activehost = 1
AddScriptControl config check "$Msg_SS_activemode" activemode = 1
AddScriptControl config check "$Msg_SS_activeinvite" activeinvite = 1
AddScriptControl config check "$Msg_SS_dccautoacceptchat" dccautoacceptchat = 0
AddScriptControl config check "$Msg_SS_dccautoacceptsend" dccautoacceptsend = 0
AddScriptControl config check " $Msg_SS_dccautoresume" dccautoresume = 0
AddScriptControl config edit "$Msg_SS_dccwarnexts" dccwarnexts = exe,lib,vsc,vbs,js,bat,com,pif,doc,xls,shs,scr
AddScriptControl config check "$Msg_SS_flashtray" flashtray = 1
AddScriptControl config check "$Msg_SS_flashtaskbar" flashtaskbar = 0
AddEventSound virc_start "$Msg_ES_virc" "$Msg_ES_virc_start" default vircstart.wav
AddEventSound virc_exit "$Msg_ES_virc" "$Msg_ES_virc_exit" default vircexit.wav
AddEventSound notify_join "$Msg_ES_virc" "$Msg_ES_notify_join" default nfyjoin.wav
AddEventSound notify_quit "$Msg_ES_virc" "$Msg_ES_notify_quit" default nfyquit.wav
AddEventSound virc_connect "$Msg_ES_virc" "$Msg_ES_virc_connect" default connect.wav
AddEventSound virc_disconnect "$Msg_ES_virc" "$Msg_ES_virc_disconnect" default disconnect.wav
AddEventSound virc_dcc "$Msg_ES_dcc" "$Msg_ES_virc_dcc" default dcc.wav
AddEventSound dcc_chattext "$Msg_ES_dcc" "$Msg_ES_dcc_chattext" default msg.wav
AddEventSound irc_join "$Msg_ES_irc" "$Msg_ES_irc_join" default join.wav
AddEventSound irc_part "$Msg_ES_irc" "$Msg_ES_irc_part" default part.wav
AddEventSound irc_quit "$Msg_ES_irc" "$Msg_ES_irc_quit" default part.wav
AddEventSound irc_msg "$Msg_ES_irc" "$Msg_ES_irc_msg" default msg.wav
AddEventSound irc_notice "$Msg_ES_irc" "$Msg_ES_irc_notice" default notice.wav
AddEventSound irc_chantext "$Msg_ES_irc" "$Msg_ES_irc_chantext" default chantext.wav
AddEventSound irc_chanmsg "$Msg_ES_irc" "$Msg_ES_irc_chanmsg" default msg.wav
AddEventSound irc_querytext "$Msg_ES_irc" "$Msg_ES_irc_querytext" default msg.wav
AddEventSound irc_chanact "$Msg_ES_irc" "$Msg_ES_irc_chanact" default chantext.wav
AddEventSound irc_invite "$Msg_ES_irc" "$Msg_ES_irc_invite" default invite.wav
AddEventSound irc_mode "$Msg_ES_irc" "$Msg_ES_irc_mode" default mode.wav
AddEventSound irc_kick "$Msg_ES_irc" "$Msg_ES_irc_kick" default kick.wav
AddEventSound irc_nick "$Msg_ES_irc" "$Msg_ES_irc_nick" default nickchange.wav
AddEventSound irc_servernotice "$Msg_ES_irc" "$Msg_ES_irc_servernotice" default servnotice.wav
AddEventSound irc_ctcp "$Msg_ES_irc" "$Msg_ES_irc_ctcp" default ctcp.wav
AddEventSound irc_rctcp "$Msg_ES_irc" "$Msg_ES_irc_rctcp" default ctcp.wav
AddEventSound irc_ping "$Msg_ES_irc" "$Msg_ES_irc_ping" default ping.wav
AddEventSound irc_rping "$Msg_ES_irc" "$Msg_ES_irc_rping" default ping.wav
AddEventSound irc_topic "$Msg_ES_irc" "$Msg_ES_irc_topic" default topic.wav
PlayEventSound virc_start
@ $TrayMsgCount = 0
@ $MinimizedToTray = 0
@ $InitializedTables = 0
// set up application events
@l $appevents = $mapobject(!Main:AppEvents)
@e+ $appevents.OnActivate = stopflashing, _stopflashing
// restore NLX settings
if [$nlx_config] != [$$nlx_config]
NLConfig $nlx_config
endif
// first run? load recommended scripts
if $FirstRun
@l $addons = $getsetting(Scripts AddOn)
@l $newaddons = $listunique($listcat($addons $RecommendedAddOns))
SetSetting Scripts AddOn = $newaddons
endif
// don't auto-connect if a .chat file or script is being loaded or we're importing servers
@l $do_autoconnect = 1
@l $params = $paramlist()
foreach ($i; -chat -importservers -loadscript -irchyperlink)
if $listindexof($i $params) != -1
@l $do_autoconnect = 0
break
endif
endforeach
if ($do_autoconnect)
if !($isinset([ctrl] $shiftkeys_active()))
@l $acon = $getsetting(autoconnect)
if ([$acon] != [])
foreach ($i; $acon)
OnServer $NewServerWindow() Server $i
break if $isinset([ctrl] $shiftkeys_active())
endforeach
endif
endif
endif
// set up popups
InitActivePopups
InitHyperPopup
EndEvent
Event <OnClose_virclib> "*"
// save NLX settings
@s $nlx_config = $nlconfig()
PlayEventSound virc_exit
EndEvent
Alias _STOPFLASHING
@l $trayicon = $mapobject(!Main:TrayIcon)
@p $trayicon.Flashing = False
UnmapObject $trayicon
EndAlias
Event <OnMinimizeToTray_virclib> "*"
@ $TrayMsgCount = 0
@ $MinimizedToTray = 1
@l $trayicon = $mapobject(!Main:TrayIcon)
@p $trayicon.Hint = Visual IRC ($Msg_Tray_NoMsgs)
UnmapObject $trayicon
EndEvent
Event <OnRestoreFromTray_virclib> "*"
@ $MinimizedToTray = 0
@l $trayicon = $mapobject(!Main:TrayIcon)
@p $trayicon.Hint = Visual IRC
UnmapObject $trayicon
EndEvent
Alias _INCTRAYMSGCOUNT
if ($MinimizedToTray)
$TrayMsgCount++
@l $trayicon = $mapobject(!Main:TrayIcon)
if ($TrayMsgCount == 1)
@p $trayicon.Hint = ViRC (1 $Msg_Tray_OneMsg)
else
@p $trayicon.Hint = ViRC ($TrayMsgCount $Msg_Tray_ManyMsgs)
endif
// flash tray icon if allowed
if $GetSetting(flashtray)
@p $trayicon.Flashing = True
endif
UnmapObject $trayicon
endif
// flash taskbar icon if allowed and necessary
if (!$IsAppActive()) && ($GetSetting(flashtaskbar))
FlashTaskbar auto
endif
EndAlias
@ $ConnectHooks = $null
// merge logging popup into other menus
MergeMenu MT_LOGGING after MT_SERVERPOPUP
MergeMenu MT_LOGGING after MT_CHANNELTEXTPOPUP
MergeMenu MT_LOGGING after MT_QUERYPOPUP
MergeMenu MT_LOGGING after MT_CHATPOPUP
^Load toolbars.vsc